#ifndef _MY_DEFINE_H_
#define _MY_DEFINE_H_

/*
 *串口信息
 **/
#define BAUDRATE 115200

/*
 *设备信息
 **/
#define DEV_GPRS "/dev/s3c2410_serial1"
#define DEV_ZIGBEE "/dev/ttyUSB0"
#define DEV_LED "/dev/led"
#define DEV_BUZZER "/dev/beep"
#define DEV_INFRARED "/dev/key"
#define DEV_CAMERA "/tmp/webcam"

#define LED_ON _IO('L', 10)
#define LED_OFF _IO('L', 11)
#define BUZZER_ON _IO('B', 10)
#define BUZZER_OFF _IO('B', 11)

/*
 *消息队列
 **/
#define MSGTYPE_ENV 'e'
#define MSGTYPE_GOODS 'g'
#define MSGTYPE_ACK 'a'

#define STORAGE_NUM 5

#define GOODS_NUM 10
#define GOODS_IN 'I'
#define GOODS_OUT 'O'

#define QUEUE_MSG_LEN 32

#define MSG_LED 1L
#define MSG_LED_TEM_ON 0x22
#define MSG_LED_TEM_OFF 0x20
#define MSG_LED_HUM_ON 0x44
#define MSG_LED_HUM_OFF 0x40
#define MSG_LED_ILL_ON 0x88
#define MSG_LED_ILL_OFF 0x80

#define MSG_BEEP 2L
#define MSG_BEEP_OFF 0
#define MSG_BEEP_ON 1

#define MSG_M0 4L
#define MSG_M0_FAN_OFF 0x00
#define MSG_M0_FAN_ON1 0x01
#define MSG_M0_FAN_ON2 0x02
#define MSG_M0_FAN_ON3 0x03

#define MSG_M0_BEEP_OFF 0x10
#define MSG_M0_BEEP_ON 0x11
#define MSG_M0_BEEP_AU_OFF 0x12
#define MSG_M0_BEEP_AU_ON 0x13

#define MSG_M0_LED_OFF 0x20
#define MSG_M0_LED_ON 0x21

#define MSG_M0_SEG_ON 0x30
#define MSG_M0_SEG_OFF 0x3f

#define ENV_UPDATE 0x00
#define ENV_GET 0x01
#define COLLECT_INSERTER 0x10
#define COLLECT_TIME_GET 0x11
#define COLLECT_CURRENT_GET 0x12
#define GOODS_ADD 0x20
#define GOODS_REDUCE 0x21
#define GOODS_GET 0x22

#endif
